package com.party.core.service.wallet.impl;

import com.google.common.base.Strings;
import com.party.common.paging.Page;
import com.party.core.dao.read.wallet.WithdrawalAuditOperateReadDao;
import com.party.core.dao.write.wallet.WithdrawalAuditOperateWriteDao;
import com.party.core.model.BaseModel;
import com.party.core.model.wallet.WithdrawalAuditOperate;
import com.party.core.model.wallet.WithdrawalAuditOperateOutput;
import com.party.core.service.wallet.IWithdrawalAuditOperateService;
import com.sun.istack.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
@Service
public class WithdrawalAuditOperateService implements IWithdrawalAuditOperateService {

 @Autowired
 private WithdrawalAuditOperateReadDao withdrawalAuditOperateReadDao;

 @Autowired
 private WithdrawalAuditOperateWriteDao withdrawalAuditOperateWriteDao;


    @Override
    public String insert(WithdrawalAuditOperate withdrawalAuditOperate) {
        BaseModel.preInsert(withdrawalAuditOperate);
        boolean result = withdrawalAuditOperateWriteDao.insert(withdrawalAuditOperate);
        if (result) {
            return withdrawalAuditOperate.getId();
        }
        return null;
    }

    @Override
    public boolean update(WithdrawalAuditOperate withdrawalAuditOperate) {
        withdrawalAuditOperate.setUpdateDate(new Date());
        return withdrawalAuditOperateWriteDao.update(withdrawalAuditOperate);
    }

    @Override
    public boolean deleteLogic(@NotNull String id) {
        if (Strings.isNullOrEmpty(id)) {
            return false;
        }
        return withdrawalAuditOperateWriteDao.deleteLogic(id);
    }

    @Override
    public boolean delete(String id) {
        if (Strings.isNullOrEmpty(id)) {
            return false;
        }
        return withdrawalAuditOperateWriteDao.delete(id);
    }

    @Override
    public boolean batchDeleteLogic(Set<String> ids) {
        return false;
    }

    @Override
    public boolean batchDelete(Set<String> ids) {
        return false;
    }

    @Override
    public WithdrawalAuditOperate get(String id) {
        return withdrawalAuditOperateReadDao.get(id);
    }

    @Override
    public List<WithdrawalAuditOperate> listPage(WithdrawalAuditOperate withdrawalAuditOperate, Page page) {
        return null;
    }

    @Override
    public List<WithdrawalAuditOperate> list(WithdrawalAuditOperate withdrawalAuditOperate) {
        return null;
    }

    @Override
    public List<WithdrawalAuditOperate> batchList(Set<String> ids, WithdrawalAuditOperate withdrawalAuditOperate, Page page) {
        return null;
    }

    @Override
    public List<WithdrawalAuditOperateOutput> queryTailParagraphList(Integer type, Map<String, Object> params, Page page) {
        return withdrawalAuditOperateReadDao.queryTailParagraphList(type,params,page);
    }

    @Override
    public List<WithdrawalAuditOperate> queryTailParagraphInfo(String businessId,String memberId) {
        return withdrawalAuditOperateReadDao.queryTailParagraphInfo(businessId,memberId);
    }

    @Override
    public WithdrawalAuditOperate findByWAO(String wId, Integer progress) {
        return withdrawalAuditOperateReadDao.findByWAO(wId,progress);
    }
}
